package com.example.springboothello.controller;

import com.example.springboothello.entity.User;
import com.example.springboothello.service.HelloService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class HelloController {
    @Resource
    public HelloService service;

    @RequestMapping("/hello")
    public String hello() {
        service.helloService();
        return "Hello World1";
    }
    @RequestMapping("/add")
    public String add() {
        service.add();
        return "add";
    }

    @RequestMapping("/test")
    public String test(@RequestBody User user) {
        System.out.println(user);
        return "success";
    }
}